﻿using NFine.Application.Biz;
using NFine.Code;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace NFine.Web.App_Start._02_Class
{
    public class TimerTask
    {
        private Log logger = LogFactory.GetLogger("Timer");
        private UserDetailApp userDetailApp = new UserDetailApp();

        private System.Timers.Timer _timer = null;
        private int Interval =600;
        public void Run()
        {
            _timer = new System.Timers.Timer(Interval * 1000);
            _timer.Elapsed += delegate
            {
                logger.Debug("执行数据清理    Time:" + DateTime.Now.ToLongTimeString());
                userDetailApp.DataClear();

            };
            _timer.Start();
        }
    }
}